package com.huqing.icu.rentreport.controller.admin;

import com.huqing.icu.base.BaseController;
import com.huqing.icu.rentreport.inout.in.admin.AdminReportRecordApproveReq;
import com.huqing.icu.rentreport.inout.in.admin.AdminReportRecordListQueryReq;
import com.huqing.icu.rentreport.service.admin.IAdminReportRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 后台举报记录接口
 * @Author huqing
 * @Date 2025/7/6 20:27
 **/
@RestController
@RequestMapping("/api-admin/report_record")
@Tag(name = "后台-举报记录接口")
public class AdminReportRecordController extends BaseController {

    @Autowired
    private IAdminReportRecordService iAdminReportRecordService;

    @Operation(summary = "查询举报记录列表")
    @RequestMapping(value = "/query_list", method = RequestMethod.POST, produces = "application/json")
    public String queryList(@RequestBody AdminReportRecordListQueryReq queryReq, HttpServletRequest request) {
        Long userId = checkAndGetUserId(request);
        return jsonSuccess(iAdminReportRecordService.queryList(queryReq));
    }

    @Operation(summary = "批量审核举报记录")
    @RequestMapping(value = "/batch_approve", method = RequestMethod.POST, produces = "application/json")
    public String batchApprove(@RequestBody AdminReportRecordApproveReq approveReq, HttpServletRequest request) {
        Long userId = checkAndGetUserId(request);
        return jsonSuccess(iAdminReportRecordService.batchApprove(approveReq, userId));
    }

    @Operation(summary = "测试kafka")
    @RequestMapping(value = "/test_kafka", method = RequestMethod.GET, produces = "application/json")
    public String testKafka(HttpServletRequest request) {
        return jsonSuccess(iAdminReportRecordService.testKafka());
    }
}
